package com.gyf.base.rx

import com.gyf.base.common.BaseConstant
import com.gyf.base.data.protocol.BaseResp
import rx.Observable
import rx.functions.Func1

class BaseFuncBoolean<T>:Func1<BaseResp<T>,Observable<Boolean>>{
    override fun call(t: BaseResp<T>): Observable<Boolean> {
        if (t.status !=  BaseConstant.RESUlT_CODE) {
            return Observable.error(BaseException(t.status, t.message));
        }
        return Observable.just(true);
    }
}